import request from '@/utils/request'

// 查询采购单管理列表
export function listPurchaseOrder(query) {
  return request({
    url: '/wms/purchaseOrder/list',
    method: 'get',
    params: query
  })
}

// 查询采购单管理列表(发货)
export function listPurchaseOrderBySend(query) {
  return request({
    url: '/wms/purchaseOrder/sendList',
    method: 'get',
    params: query
  })
}

// 查询采购单管理详细
export function getPurchaseOrderInfo(orderCode) {
  return request({
    url: '/wms/purchaseOrder/getInfo/' + orderCode,
    method: 'get'
  })
}

// 查询采购单管理详细
export function getPurchaseOrder(orderCode) {
  return request({
    url: '/wms/purchaseOrder/' + orderCode,
    method: 'get'
  })
}

// 查询采购单可发货商品
export function getSendProduct(orderCode) {
  return request({
    url: '/wms/purchaseOrder/getSendProduct/' + orderCode,
    method: 'get'
  })
}

// 新增采购单管理
export function addPurchaseOrder(data) {
  return request({
    url: '/wms/purchaseOrder',
    method: 'post',
    data: data
  })
}

// 采购单生产完成
export function updatePurchaseOrder(data) {
  return request({
    url: '/wms/purchaseOrder',
    method: 'put',
    data: data
  })
}

// 采购单生产完成
export function sendPurchaseOrder(data) {
  return request({
    url: '/wms/purchaseOrder/sendProduct',
    method: 'put',
    data: data
  })
}
